<template>
  <div>
    <div id="box" class="details_content">
      <div class="title">{{content.title}}</div>
      <div class="source_time">
        <div class="source">{{content.come}}</div>
        <div class="time">{{content.createtime}}</div>
      </div>
      <div v-if="textContent" class="information_content_img_style content" v-html="textContent"></div>
      <div class="likes_number">
        <span class="dianzan">
          <span class="iconfont icon-dianzan1" :class="{likes:content.is_like === 1}"></span>
          <span>{{content.likes}}</span>
        </span>
      </div>
    </div>

  </div>

</template>

<script>
  export default {
    name: 'DetailsContent',
    props:{
      content:{
        type:Object
      }
    },
    computed:{
      textContent(){
        // let rx = /(<\s*?img .*?) (width=".*?")(.*?>)/g;
        // return this.content.content.replace(rx,'$1$3');
        return this.content.content;
        // let rx = /(<p class="MsoNormal".*?style=".*?)(padding:.*?;)(.*?">.*?<\/p>)/g;
        // return this.content.content.replace(rx,'$1$3');
      }
    },
    data() {
      return {

      }
    }
  }
</script>

<style scoped>
  .details_content {
    padding: 10px;
    border-bottom: 10px solid #eeeeee;
  }

  .details_content .title {
    color: #333333;
  }

  .details_content .source_time {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 0.8rem;
    color: #999999;
  }

  .details_content .content {

  }
.details_content .likes_number{
border-top: 1px solid #eee;
  margin-top: 10px;
  padding: 10px 0;
}
  .details_content .likes_number .dianzan{
    border: 1px solid #666;
    margin: 0 auto;
    padding: 5px 20px;
    width: 3rem;
    display: flex;
    border-radius: 20px;
    justify-content: space-between;
    height: 20px;
    line-height: 20px;
  }
  .details_content .likes_number .dianzan .likes{
    color: #e6191e;
  }
</style>
